days = [0 6 10 13 17 20 28];
sp1 = [6.67 17.3 42.7 37.3 30.1 29.3 28.7];
sp2 = [6.67 16.1 18.9 15.0 10.6 9.44 8.89];
x = linspace(0, 28, 100); % 产生更多的x点以获得平滑的曲线
y1 = interp1(days, sp1, x, 'spline'); % 使用三次样条插值
y2 = interp1(days, sp2, x, 'spline');
figure;
plot(x, y1, 'r-', 'LineWidth', 1.5); hold on;
plot(x, y2, 'b-', 'LineWidth', 1.5);
scatter(days, sp1, 'ro');
scatter(days, sp2, 'bo');
xlabel('Day');
ylabel('Average Weight');
legend('Sp1', 'Sp2');
title('Average Weight Curve for Each Sample');
grid on;
